import {
  get,
  post,
  put
} from '@/utils/request'

// 新增田信息
export function addFiled(params) {
  return post(`/farm-jdcx/field`, params);
}

// 获取田详情
export function getFieldDetails(params) {
  return get(`/farm-jdcx/field/${params}`);
}

// 修改田信息
export function editFiled(params) {
  return put(`/farm-jdcx/field`, params);
}

// 获取海波高度
export const getAltitude = (params) => {
  return new Promise((resolve) => {
    resolve({ code: 0, resData: 12 })
  })
}

// 获取坡度
export const getSlope = (params) => {
  return new Promise((resolve) => {
    resolve({ code: 0, resData: 7.6 })
  })
}

export default {
  getAltitude,
  getSlope
};

// 公用base64
export function uploadBase64(params) {
  return post(`/farm-jdcx/config/uploadBase64`, {}, params);
}
export const getCropList = (params) => get('/farm-jdcx/crop/getCropList', params)

// 根据经纬度查询地址接口
export function homepageAddress(params) {
  return get(`/farm-jdcx/homepage/address`, params);
}

